/*
 * Created on Jun 24, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/*
 * This software is distributed under the MIT License
 *
 * Copyright (c) 2005 Alain Becam, Paulo Lopes, Joakim Olsson, and Johan Simonsson - 2005
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this 
 * software and associated documentation files (the "Software"), to deal in the Software 
 * without restriction, including without limitation the rights to use, copy, modify, 
 * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 
 * permit persons to whom the Software is furnished to do so, subject to the following 
 * conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all copies
 *  or substantial portions of the Software.
 * 
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * 
 */

package modulesrepository;

/**
 * @author Alain Becam
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class DummyReceiver implements IDummyReceiver
{
    /* (non-Javadoc)
     * @see modulesrepository.IDummyReceiver#returnPos()
     */
    public String returnPos()
    {
        // TODO Auto-generated method stub
        return null;
    }

    synchronized public String managePos(float x, float y)
    {
        // In this idiotic test, we take the coord. received and we send back some calculated coord,
        // So the client can render some other entities...
        // Hum hum... blah blah blah... might be good to have more than 1 other candidate...
        // Let do something very stupid
        int nbEntities = Math.round((Math.abs(x*y))/50);
        StringBuffer myOutput = new StringBuffer();
        
        // Let create our army !!!!
        for (int i = 0 ; i < nbEntities ; i++)
        {
            float xE, yE;
            xE = x + (i % 10)*2;
            yE = y + Math.round(i / 10);
            
            myOutput = myOutput.append(xE + " : " + yE + "/");
        }
        myOutput.append("#");
        return (new String(myOutput));
    }
}
